package com.dyh.hissystem.controller;

import com.dyh.hissystem.dto.Menu;
import com.dyh.hissystem.service.MenuService;
import com.dyh.hissystem.util.RespUtil;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @author Administrator
 * @data 2024/11/4
 */

@RestController
@CrossOrigin
@Log4j2
public class MenuController {
    private final MenuService menuService;
    public MenuController(MenuService menuService){
        this.menuService = menuService;
    }

    @PostMapping("/findAllMenu")
    public RespUtil getMenu(@RequestBody String userId){
//        System.out.println(userId);
//        System.out.println("用户id为："+userId+"提交了获取菜单的请求");
        return RespUtil.success(menuService.findMenuByUserId(userId));
    }
}
